#include "comm.hpp"

int main()
{
    // 打开管道
    int fd = open(FIFO_FILE, O_WRONLY);
    
    if (fd < 0)
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }

    // 发生信息给server
    string line;
    while (true)
    {
        cout << "请输入要发送信息 :";
        getline(cin, line);

        write(fd, line.c_str(), line.size());
    }

    close(fd);
    return 0;
}